package com.yy.qpgame.server;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import com.yy.qpgame.server.dao.UserInfoMapper;
import com.yy.qpgame.server.model.UserInfo;

import java.io.IOException;
import java.io.Reader;

public class fsgsdfg {

    private static SqlSessionFactory sqlSessionFactory;



    public static void main(String[] args) throws IOException {
        Reader reader = Resources.getResourceAsReader("mybatis-config.xml");
        sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
        SqlSession sqlSession = sqlSessionFactory.openSession();
        UserInfoMapper mapper = sqlSession.getMapper(UserInfoMapper.class);
        UserInfo hahaha = mapper.selectByPrimaryKey("hahahsssa");
        if (hahaha==null){
            System.out.println("账号不存在");
        }



    }

}
